<!DOCTYPE html>
<html>
<head>
    {include file="public/header" /}
</head>
<body>
<div style="padding-bottom:200px" class="layui-form layuimini-form">
    <!--<form class="layui-form" action="">-->
        <input type="hidden" name="id" value="{$res.id}" />
    <div class="layui-form-item">
        <label class="layui-form-label required">名称</label>
        <div class="layui-input-block">
            <input type="text" disabled value="{$res.title}"   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">交易次数</label>
        <div class="layui-input-block">
            <input type="number" id="trade_num" lay-reqtext="交易次数不能为空"  value="{$res.trade_num}"   name="trade_num" lay-verify="required"     class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">直推人数</label>
        <div class="layui-input-block">
            <input type="number" id="share_num" lay-reqtext="直推人数不能为空" value="{$res.share_num}" name="share_num" lay-verify="required"     class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">团队内人数</label>
        <div class="layui-input-block">
            <input type="number" id="team_people" lay-reqtext="团队内人数不能为空" value="{$res.team_people}" name="team_people" lay-verify="required"    class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">所需积分</label>
        <div class="layui-input-block">
            <input type="number" id="integral" lay-reqtext="所需积分不能为空" value="{$res.integral}" name="integral" lay-verify="required"    class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label required">消费金额限制</label>
        <div class="layui-input-block">
            <input type="number" id="consumption_amount"  value="{$res.consumption_amount}" name="consumption_amount"     class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">金币充值次数</label>
        <div class="layui-input-block">
            <input type="number" id="recharge_times"  value="{$res.recharge_times}" name="recharge_times"     class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">完成任务需金币/人</label>
        <div class="layui-input-block">
            <input type="number" id="goldFinish"  value="{$res.goldfinish}" name="goldfinish"     class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">队员级别限制</label>
        <div class="layui-input-block" style="width:100px">
            <input type="checkbox" lay-filter="switchTest" name="is_limits" {if condition="$res.is_limits==2"} checked {/if} lay-skin="switch" lay-text="开|关">
        </div>
    </div>


    <div id="bb" {if condition="$res.is_limits==1"} style="display: none" {/if} data-display='{$res.is_limits}'  >

    <div class="layui-form-item" style="padding-left: 30px;">
        <label class="layui-form-label required">添加限制</label>
        <div class="layui-input-block">
            <button type="button"  onclick="additem()" class="layui-btn" >添加</button>
        </div>
    </div>
    {if condition="$res.is_limits==2"}
    {volist name="$res.levels" id="v" key="k"}
    <div class="layui-form-item " >
                    <label class="layui-form-label" style="margin-left:50px;width:50px">限制{$k}</label>
                    <div class="layui-inline" >
                            <label class="layui-form-label">级别</label>
                            <div class="layui-input-block ">
                                    <select name="member_level[]"   >
                                        {volist name='industry_level_arr' id='vv'}
                                        <option {if condition="$v.member_level==$vv.id"} selected {/if}  value="{$vv.id}">{$vv.title}</option>
                                        {/volist}
                                    </select>
                            </div>
                        </div>
                    <div class="layui-inline" >
                            <label class="layui-form-label">人数</label>
                           <div class="layui-input-inline">
                                    <input type="number" name="member_num[]"   value="{$v.member_num}"      class="layui-input cycle_income"  >
                                </div>
                        </div>
                    <div class="layui-inline" style="width: 50px">
                            <div class="layui-input-inline">
                                <button type="button" onclick="delcycle(this)" class="layui-btn">删除</button>
                                </div>
                        </div>
                </div>
    {/volist}
    {else}
    <div class="layui-form-item " >
        <label class="layui-form-label" style="margin-left:50px;width:50px">限制1</label>
        <div class="layui-inline" >
            <label class="layui-form-label">级别</label>
            <div class="layui-input-block ">
                <select name="member_level[]"   >
                    {volist name='industry_level_arr' id='v'}
                    <option  value="{$v.id}">{$v.title}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-inline" >
            <label class="layui-form-label">人数</label>
            <div class="layui-input-inline">
                <input type="number" name="member_num[]"   value="0"      class="layui-input cycle_income"  >
            </div>
        </div>
        <div class="layui-inline" style="width: 50px">
            <div class="layui-input-inline">
                <button type="button" onclick="delcycle(this)" class="layui-btn">删除</button>
            </div>
        </div>
    </div>

    {/if}


    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script src="/static/admin/industry/savelevels.js?v={$Think.const.TIMESTAMP}" charset="utf-8"></script>

<script>

</script>

</body>
</html>